package com.zyj.demo.controller;

import com.zyj.demo.service.DemoService;
import com.zyj.mvcframework.annoation.ZyjAutowired;
import com.zyj.mvcframework.annoation.ZyjController;
import com.zyj.mvcframework.annoation.ZyjRequestMapping;
import com.zyj.mvcframework.annoation.ZyjRequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 29015
 */
@ZyjController
@ZyjRequestMapping("/demo")
public class DemoController {
    @ZyjAutowired
    private DemoService demoService;
    @ZyjRequestMapping("/hello")
    public void test(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        resp.getWriter().write("sda");
    }
    @ZyjRequestMapping("/add")
    public void add(HttpServletRequest req, HttpServletResponse resp, @ZyjRequestParam("name") String name) throws Exception{
        resp.getWriter().write(name);
    }
}
